/**
 * 环境配置封装
 */
const env: unknown = process.env.NODE_ENV || "production";

const EnvConfig = {
  development: {
    baseApi: "/api",
    mockApi:
      "https://www.fastmock.site/mock/c1c302e8baed9894c48c17e4738c092e/api",
  },
  test: {
    baseApi: "/api",
    mockApi:
      "https://www.fastmock.site/mock/c1c302e8baed9894c48c17e4738c092e/api",
  },
  production: {
    baseApi: "/api",
    mockApi:
      "https://www.fastmock.site/mock/c1c302e8baed9894c48c17e4738c092e/api",
  },
};
const api = {
  env,
  mock: false,
  namespace: "train",
  ...EnvConfig[env as string],
};

export const realmUrl =
  env === "development" ? "http://127.0.0.1:8010/" : "http://127.0.0.1:8010/"; // 全局图片地址
export const actionPath = `${realmUrl}api/common/upload/image`;

export default api;
